home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue54 / Construc / BobNotes_C.pas next >
Encoding:
Pascal/Delphi Source File  |  2000-01-03  |  15.4 KB  |  393 lines

  1. unit BobNotes_c;
  2.  
  3. { This file was generated on 3 Jan 2000 15:45:40 GMT by version 03.03.02.C3.03    }
  4. { of the Inprise VisiBroker idl2pas CORBA IDL compiler.                             }
  5.  
  6. { Please do not edit the contents of this file. If you wish to modify them you      }
  7. { should do so by editing and recompiling the original IDL which was located in the }
  8. { fileBOBNOTES.IDL. }
  9.  
  10. { Delphi Pascal unit BobNotes_c for the BobNotes IDL module. }
  11. { The purpose of this file is to implement the client-side classes (stubs) required  }
  12. { by the associated Interface unit (BobNotes_i). }
  13. { This unit must be matched with the associated skeleton unit on the server side. }
  14.  
  15. { This unit contains the stub code for IDL module BobNotes. }
  16. {** IDL Source     : "BOBNOTES.IDL", line 1
  17.  ** IDL Name       : module
  18.  ** Repository Id  : IDL:BobNotes:1.0
  19.  **}
  20.  
  21.  
  22. interface
  23.  
  24. uses
  25.   CORBA,
  26.   BobNotes_i;
  27.  
  28.  
  29. type
  30.   TICorBobNotesHelper = class;
  31.   TICorBobNotesStub = class;
  32.   TCorBobNotesFactoryHelper = class;
  33.   TCorBobNotesFactoryStub = class;
  34.  
  35.  
  36.   { Pascal helper class "BobNotes_c.TICorBobNotesHelper" for the Pascal interface "BobNotes_i.ICorBobNotes". }
  37.   {** IDL Source     : "BOBNOTES.IDL", line 6
  38.    ** IDL Name       : interface
  39.    ** Repository Id  : IDL:BobNotes/ICorBobNotes:1.0
  40.    **}
  41.   TICorBobNotesHelper = class
  42.     class procedure Insert (var _A: CORBA.Any; const _Value : BobNotes_i.ICorBobNotes);
  43.     class function  Extract(var _A: CORBA.Any) : BobNotes_i.ICorBobNotes;
  44.     class function  TypeCode     : CORBA.TypeCode;
  45.     class function  RepositoryId : string;
  46.     class function  Read (const _Input  : CORBA.InputStream) : BobNotes_i.ICorBobNotes;
  47.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : BobNotes_i.ICorBobNotes);
  48.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : BobNotes_i.ICorBobNotes;
  49.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : BobNotes_i.ICorBobNotes; overload;
  50.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : BobNotes_i.ICorBobNotes; overload;
  51.   end;
  52.  
  53.  
  54.   { Pascal stub class "BobNotes_c.TICorBobNotesStub supporting the Pascal interface "BobNotes_i.ICorBobNotes". }
  55.   {** IDL Source     : "BOBNOTES.IDL", line 6
  56.    ** IDL Name       : interface
  57.    ** Repository Id  : IDL:BobNotes/ICorBobNotes:1.0
  58.    **}
  59.  
  60.   TICorBobNotesStub = class(CORBA.TCORBAObject, BobNotes_i.ICorBobNotes)
  61.   public
  62.     {** IDL Source     : "BOBNOTES.IDL", line 8
  63.      ** IDL Name       : operation
  64.      ** Repository Id  : IDL:BobNotes/ICorBobNotes/GetLines:1.0
  65.      **}
  66.     procedure  GetLines ( const User : WideString;
  67.                           const Password : WideString;
  68.                           out   Lines : WideString); virtual;
  69.     {** IDL Source     : "BOBNOTES.IDL", line 9
  70.      ** IDL Name       : operation
  71.      ** Repository Id  : IDL:BobNotes/ICorBobNotes/SetLines:1.0
  72.      **}
  73.     procedure  SetLines ( const User : WideString;
  74.                           const Password : WideString;
  75.                           const Lines : WideString); virtual;
  76.     {** IDL Source     : "BOBNOTES.IDL", line 10
  77.      ** IDL Name       : operation
  78.      ** Repository Id  : IDL:BobNotes/ICorBobNotes/Answer:1.0
  79.      **}
  80.     procedure  Answer ( out   Answer : Integer); virtual;
  81.     {** IDL Source     : "BOBNOTES.IDL", line 11
  82.      ** IDL Name       : operation
  83.      ** Repository Id  : IDL:BobNotes/ICorBobNotes/StringAnswer:1.0
  84.      **}
  85.     procedure  StringAnswer ( const Question : Integer;
  86.                               out   Answer : WideString); virtual;
  87.     {** IDL Source     : "BOBNOTES.IDL", line 12
  88.      ** IDL Name       : operation
  89.      ** Repository Id  : IDL:BobNotes/ICorBobNotes/StringAnswer2:1.0
  90.      **}
  91.     procedure  StringAnswer2 ( const Question : WideString;
  92.                                out   Answer : WideString); virtual;
  93.  
  94.   end;
  95.  
  96.  
  97.   { Pascal helper class "BobNotes_c.TCorBobNotesFactoryHelper" for the Pascal interface "BobNotes_i.CorBobNotesFactory". }
  98.   {** IDL Source     : "BOBNOTES.IDL", line 15
  99.    ** IDL Name       : interface
  100.    ** Repository Id  : IDL:BobNotes/CorBobNotesFactory:1.0
  101.    **}
  102.   TCorBobNotesFactoryHelper = class
  103.     class procedure Insert (var _A: CORBA.Any; const _Value : BobNotes_i.CorBobNotesFactory);
  104.     class function  Extract(var _A: CORBA.Any) : BobNotes_i.CorBobNotesFactory;
  105.     class function  TypeCode     : CORBA.TypeCode;
  106.     class function  RepositoryId : string;
  107.     class function  Read (const _Input  : CORBA.InputStream) : BobNotes_i.CorBobNotesFactory;
  108.     class procedure Write(const _Output : CORBA.OutputStream; const _Value : BobNotes_i.CorBobNotesFactory);
  109.     class function  Narrow(const _Obj   : CORBA.CORBAObject; _IsA : Boolean = False) : BobNotes_i.CorBobNotesFactory;
  110.     class function  Bind(const _InstanceName : string = ''; _HostName : string = '') : BobNotes_i.CorBobNotesFactory; overload;
  111.     class function  Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName: string = '') : BobNotes_i.CorBobNotesFactory; overload;
  112.   end;
  113.  
  114.  
  115.   { Pascal stub class "BobNotes_c.TCorBobNotesFactoryStub supporting the Pascal interface "BobNotes_i.CorBobNotesFactory". }
  116.   {** IDL Source     : "BOBNOTES.IDL", line 15
  117.    ** IDL Name       : interface
  118.    ** Repository Id  : IDL:BobNotes/CorBobNotesFactory:1.0
  119.    **}
  120.  
  121.   TCorBobNotesFactoryStub = class(CORBA.TCORBAObject, BobNotes_i.CorBobNotesFactory)
  122.   public
  123.     {** IDL Source     : "BOBNOTES.IDL", line 17
  124.      ** IDL Name       : operation
  125.      ** Repository Id  : IDL:BobNotes/CorBobNotesFactory/CreateInstance:1.0
  126.      **}
  127.     function   CreateInstance ( const InstanceName : AnsiString): BobNotes_i.ICorBobNotes; virtual;
  128.  
  129.   end;
  130.  
  131.  
  132. implementation
  133.  
  134.  
  135. { Implementation of the Pascal helper class "BobNotes_c.TICorBobNotesHelper" supporting the Pascal interface "BobNotes_i.ICorBobNotes. }
  136. {** IDL Source     : "BOBNOTES.IDL", line 6
  137.  ** IDL Name       : interface
  138.  ** Repository Id  : IDL:BobNotes/ICorBobNotes:1.0
  139.  **}
  140. class procedure TICorBobNotesHelper.Insert(var _A : CORBA.Any; const _Value : BobNotes_i.ICorBobNotes);
  141. begin
  142.   _A := Orb.MakeObjectRef( TICorBobNotesHelper.TypeCode, _Value as CORBA.CORBAObject);
  143. end;
  144.  
  145. class function TICorBobNotesHelper.Extract(var _A : CORBA.Any): BobNotes_i.ICorBobNotes;
  146. var
  147.   _obj : Corba.CorbaObject;
  148. begin
  149.   _obj := Orb.GetObjectRef(_A);
  150.   Result := TICorBobNotesHelper.Narrow(_obj, True);
  151. end;
  152.  
  153. class function TICorBobNotesHelper.TypeCode : CORBA.TypeCode;
  154. begin
  155.   Result := ORB.CreateInterfaceTC(RepositoryId, 'ICorBobNotes');
  156. end;
  157.  
  158. class function TICorBobNotesHelper.RepositoryId : string;
  159. begin
  160.   Result := 'IDL:BobNotes/ICorBobNotes:1.0';
  161. end;
  162.  
  163. class function TICorBobNotesHelper.Read(const _Input : CORBA.InputStream) : BobNotes_i.ICorBobNotes;
  164. var
  165.   _Obj : CORBA.CORBAObject;
  166. begin
  167.   _Input.ReadObject(_Obj);
  168.   Result := Narrow(_Obj, True)
  169. end;
  170.  
  171. class procedure TICorBobNotesHelper.Write(const _Output : CORBA.OutputStream; const _Value : BobNotes_i.ICorBobNotes);
  172. begin
  173.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  174. end;
  175.  
  176. class function TICorBobNotesHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : BobNotes_i.ICorBobNotes;
  177. begin
  178.   Result := nil;
  179.   if (_Obj = nil) or (_Obj.QueryInterface(BobNotes_i.ICorBobNotes, Result) = 0)
  180.     then Exit;
  181.   if _IsA and _Obj._IsA(RepositoryId) then
  182.     Result := TICorBobNotesStub.Create(_Obj);
  183. end;
  184.  
  185. class function TICorBobNotesHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : BobNotes_i.ICorBobNotes;
  186. begin
  187.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  188. end;
  189.  
  190. class function TICorBobNotesHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : BobNotes_i.ICorBobNotes;
  191. begin
  192.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  193. end;
  194.  
  195. { Implementation of the Pascal stub class "BobNotes_c.TICorBobNotesStub" supporting the Pascal "BobNotes_i.ICorBobNotes" interface. }
  196.  
  197. { Implementation of Interface methods representing IDL operations. }
  198.   {** IDL Source     : "BOBNOTES.IDL", line 8
  199.    ** IDL Name       : operation
  200.    ** Repository Id  : IDL:BobNotes/ICorBobNotes/GetLines:1.0
  201.    **}
  202.   procedure  TICorBobNotesStub.GetLines ( const User : WideString;
  203.                                           const Password : WideString;
  204.                                           out   Lines : WideString);
  205.   var
  206.     _Output: CORBA.OutputStream;
  207.     _Input : CORBA.InputStream;
  208.   begin
  209.     inherited _CreateRequest('GetLines',True, _Output);
  210.     _Output.WriteWstring(User);
  211.     _Output.WriteWstring(Password);
  212.     inherited _Invoke(_Output, _Input);
  213.     _Input.ReadWstring(Lines);
  214.   end;
  215.  
  216.   {** IDL Source     : "BOBNOTES.IDL", line 9
  217.    ** IDL Name       : operation
  218.    ** Repository Id  : IDL:BobNotes/ICorBobNotes/SetLines:1.0
  219.    **}
  220.   procedure  TICorBobNotesStub.SetLines ( const User : WideString;
  221.                                           const Password : WideString;
  222.                                           const Lines : WideString);
  223.   var
  224.     _Output: CORBA.OutputStream;
  225.     _Input : CORBA.InputStream;
  226.   begin
  227.     inherited _CreateRequest('SetLines',True, _Output);
  228.     _Output.WriteWstring(User);
  229.     _Output.WriteWstring(Password);
  230.     _Output.WriteWstring(Lines);
  231.     inherited _Invoke(_Output, _Input);
  232.   end;
  233.  
  234.   {** IDL Source     : "BOBNOTES.IDL", line 10
  235.    ** IDL Name       : operation
  236.    ** Repository Id  : IDL:BobNotes/ICorBobNotes/Answer:1.0
  237.    **}
  238.   procedure  TICorBobNotesStub.Answer ( out   Answer : Integer);
  239.   var
  240.     _Output: CORBA.OutputStream;
  241.     _Input : CORBA.InputStream;
  242.   begin
  243.     inherited _CreateRequest('Answer',True, _Output);
  244.     inherited _Invoke(_Output, _Input);
  245.     _Input.ReadLong(Answer);
  246.   end;
  247.  
  248.   {** IDL Source     : "BOBNOTES.IDL", line 11
  249.    ** IDL Name       : operation
  250.    ** Repository Id  : IDL:BobNotes/ICorBobNotes/StringAnswer:1.0
  251.    **}
  252.   procedure  TICorBobNotesStub.StringAnswer ( const Question : Integer;
  253.                                               out   Answer : WideString);
  254.   var
  255.     _Output: CORBA.OutputStream;
  256.     _Input : CORBA.InputStream;
  257.   begin
  258.     inherited _CreateRequest('StringAnswer',True, _Output);
  259.     _Output.WriteLong(Question);
  260.     inherited _Invoke(_Output, _Input);
  261.     _Input.ReadWstring(Answer);
  262.   end;
  263.  
  264.   {** IDL Source     : "BOBNOTES.IDL", line 12
  265.    ** IDL Name       : operation
  266.    ** Repository Id  : IDL:BobNotes/ICorBobNotes/StringAnswer2:1.0
  267.    **}
  268.   procedure  TICorBobNotesStub.StringAnswer2 ( const Question : WideString;
  269.                                                out   Answer : WideString);
  270.   var
  271.     _Output: CORBA.OutputStream;
  272.     _Input : CORBA.InputStream;
  273.   begin
  274.     inherited _CreateRequest('StringAnswer2',True, _Output);
  275.     _Output.WriteWstring(Question);
  276.     inherited _Invoke(_Output, _Input);
  277.     _Input.ReadWstring(Answer);
  278.   end;
  279.  
  280.  
  281.  
  282. { Implementation of the Pascal helper class "BobNotes_c.TCorBobNotesFactoryHelper" supporting the Pascal interface "BobNotes_i.CorBobNotesFactory. }
  283. {** IDL Source     : "BOBNOTES.IDL", line 15
  284.  ** IDL Name       : interface
  285.  ** Repository Id  : IDL:BobNotes/CorBobNotesFactory:1.0
  286.  **}
  287. class procedure TCorBobNotesFactoryHelper.Insert(var _A : CORBA.Any; const _Value : BobNotes_i.CorBobNotesFactory);
  288. begin
  289.   _A := Orb.MakeObjectRef( TCorBobNotesFactoryHelper.TypeCode, _Value as CORBA.CORBAObject);
  290. end;
  291.  
  292. class function TCorBobNotesFactoryHelper.Extract(var _A : CORBA.Any): BobNotes_i.CorBobNotesFactory;
  293. var
  294.   _obj : Corba.CorbaObject;
  295. begin
  296.   _obj := Orb.GetObjectRef(_A);
  297.   Result := TCorBobNotesFactoryHelper.Narrow(_obj, True);
  298. end;
  299.  
  300. class function TCorBobNotesFactoryHelper.TypeCode : CORBA.TypeCode;
  301. begin
  302.   Result := ORB.CreateInterfaceTC(RepositoryId, 'CorBobNotesFactory');
  303. end;
  304.  
  305. class function TCorBobNotesFactoryHelper.RepositoryId : string;
  306. begin
  307.   Result := 'IDL:BobNotes/CorBobNotesFactory:1.0';
  308. end;
  309.  
  310. class function TCorBobNotesFactoryHelper.Read(const _Input : CORBA.InputStream) : BobNotes_i.CorBobNotesFactory;
  311. var
  312.   _Obj : CORBA.CORBAObject;
  313. begin
  314.   _Input.ReadObject(_Obj);
  315.   Result := Narrow(_Obj, True)
  316. end;
  317.  
  318. class procedure TCorBobNotesFactoryHelper.Write(const _Output : CORBA.OutputStream; const _Value : BobNotes_i.CorBobNotesFactory);
  319. begin
  320.   _Output.WriteObject(_Value as CORBA.CORBAObject);
  321. end;
  322.  
  323. class function TCorBobNotesFactoryHelper.Narrow(const _Obj : CORBA.CORBAObject; _IsA : Boolean) : BobNotes_i.CorBobNotesFactory;
  324. begin
  325.   Result := nil;
  326.   if (_Obj = nil) or (_Obj.QueryInterface(BobNotes_i.CorBobNotesFactory, Result) = 0)
  327.     then Exit;
  328.   if _IsA and _Obj._IsA(RepositoryId) then
  329.     Result := TCorBobNotesFactoryStub.Create(_Obj);
  330. end;
  331.  
  332. class function TCorBobNotesFactoryHelper.Bind(const _InstanceName : string = ''; _HostName: string = '') : BobNotes_i.CorBobNotesFactory;
  333. begin
  334.   Result := Narrow(ORB.bind(RepositoryId, _InstanceName, _HostName), True);
  335. end;
  336.  
  337. class function TCorBobNotesFactoryHelper.Bind(_Options : BindOptions; const _InstanceName : string = ''; _HostName : string = '') : BobNotes_i.CorBobNotesFactory;
  338. begin
  339.   Result := Narrow(ORB.bind(RepositoryId, _Options, _InstanceName, _HostName), True);
  340. end;
  341.  
  342. { Implementation of the Pascal stub class "BobNotes_c.TCorBobNotesFactoryStub" supporting the Pascal "BobNotes_i.CorBobNotesFactory" interface. }
  343.  
  344. { Implementation of Interface methods representing IDL operations. }
  345.   {** IDL Source     : "BOBNOTES.IDL", line 17
  346.    ** IDL Name       : operation
  347.    ** Repository Id  : IDL:BobNotes/CorBobNotesFactory/CreateInstance:1.0
  348.    **}
  349.   function   TCorBobNotesFactoryStub.CreateInstance ( const InstanceName : AnsiString): BobNotes_i.ICorBobNotes;
  350.   var
  351.     _Output: CORBA.OutputStream;
  352.     _Input : CORBA.InputStream;
  353.   begin
  354.     inherited _CreateRequest('CreateInstance',True, _Output);
  355.     _Output.WriteString(InstanceName);
  356.     inherited _Invoke(_Output, _Input);
  357.     Result := BobNotes_c.TICorBobNotesHelper.Read(_Input);
  358.   end;
  359.  
  360.  
  361.  
  362. initialization
  363.  
  364.   { Initialization of the Pascal helper class "BobNotes_c.TICorBobNotesStub". }
  365.   {** IDL Source     : "BOBNOTES.IDL", line 6
  366.    ** IDL Name       : interface
  367.    ** Repository Id  : IDL:BobNotes/ICorBobNotes:1.0
  368.    **}
  369.   CORBA.InterfaceIDManager.RegisterInterface(BobNotes_i.ICorBobNotes, BobNotes_c.TICorBobNotesHelper.RepositoryId);
  370.  
  371.   { Initialization of the BobNotes_c.TICorBobNotesStub interface stub for the BobNotes_i.ICorBobNotesInterface. }
  372.   {** IDL Source     : "BOBNOTES.IDL", line 6
  373.    ** IDL Name       : interface
  374.    ** Repository Id  : IDL:BobNotes/ICorBobNotes:1.0
  375.    **}
  376.   CORBA.StubManager.RegisterStub(BobNotes_i.ICorBobNotes, BobNotes_c.TICorBobNotesStub);
  377.  
  378.   { Initialization of the Pascal helper class "BobNotes_c.TCorBobNotesFactoryStub". }
  379.   {** IDL Source     : "BOBNOTES.IDL", line 15
  380.    ** IDL Name       : interface
  381.    ** Repository Id  : IDL:BobNotes/CorBobNotesFactory:1.0
  382.    **}
  383.   CORBA.InterfaceIDManager.RegisterInterface(BobNotes_i.CorBobNotesFactory, BobNotes_c.TCorBobNotesFactoryHelper.RepositoryId);
  384.  
  385.   { Initialization of the BobNotes_c.TCorBobNotesFactoryStub interface stub for the BobNotes_i.CorBobNotesFactoryInterface. }
  386.   {** IDL Source     : "BOBNOTES.IDL", line 15
  387.    ** IDL Name       : interface
  388.    ** Repository Id  : IDL:BobNotes/CorBobNotesFactory:1.0
  389.    **}
  390.   CORBA.StubManager.RegisterStub(BobNotes_i.CorBobNotesFactory, BobNotes_c.TCorBobNotesFactoryStub);
  391.  
  392.  
  393. end.